package com.truesai.pages.customer;

import org.apache.tapestry5.EventConstants;
import org.apache.tapestry5.annotations.OnEvent;
import org.apache.tapestry5.annotations.PageActivationContext;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.annotations.Inject;

import com.truesai.dal.CrudServiceDAO;
import com.truesai.entities.customer.Customer;

/**
 * 客户信息修改页面
 * @author XuLian
 */
public class CustomerEdit {

	@Property
	@PageActivationContext
	private Customer customer;

	@Inject
	private CrudServiceDAO dao;

	private Long customerId;

	/**
	 * Start booking process.
	 * 
	 * @param hotel
	 * @return link to the current hotel booking
	 */
	@OnEvent(value = EventConstants.SUCCESS, component = "startBookingForm")
	Object startBooking(Customer customer)
	{
		System.out.println(customer!=null ? "customer : id is "+customer.getId()+", name is "+customer.getName() : "customer is null.");
		return null;
	}

	public void set(Customer customer) {
		this.customer = customer;
	}
}
